﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StreetlightGames.XnaEngine;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace StreetlightGames.SpaceShooter
{
    public class Missile : ModelObject
    {
        public Missile(Game game)
            : base(game)
        {
            ModelName = "Models\\GalagaMissile";
            Scale = 50;
        }

        public override void Update(GameTime gameTime)
        {
            if (Position.Z < -2000 || Position.Z > 100)
            {
                IsAlive = false;
            }
            base.Update(gameTime);
        }

        internal void Launch()
        {
            IsAlive = true;
            Velocity = new Vector3(0, 0, -1000);
            AudioController.Instance.PlayCue("MissileLaunch");
        }

        internal void Explode()
        {
            IsAlive = false;
        }
    }
}
